/*
 * @Descripttion: 写点什么
 * @version: 
 * @Author: Zhaocy
 * @Date: 2024-07-31 15:08:06
 * @LastEditors: Zhaocy
 * @LastEditTime: 2024-07-31 15:08:18
 */
package com.zhike.mapper.messages;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zhike.common.dto.OfflineMsgDTO;

public interface MessagesMapper {
    /**
     * 根据fingerPrint查询是否有离线消息
     *
     * @param fingerPrint fingerPrint
     * @return 结果
     */
    Integer queryOfflineHistoryCountByFingerPrint(@Param("fingerPrint") String fingerPrint);

    /**
     * 新增临时聊天消息
     *
     * @param fromUid         fromUid
     * @param toUid           toUid
     * @param msgType         msgType
     * @param message         message
     * @param messageContent2 messageContent2
     * @param historyTime2    historyTime2
     * @param chatType        chatType
     * @param groupId         groupId
     * @param parentFp        parentFp
     * @return 结果
     */
    Boolean insertOfflineHistoryData(@Param("fromUid") String fromUid,
            @Param("toUid") String toUid,
            @Param("msgType") String msgType,
            @Param("message") String message,
            @Param("messageContent2") String messageContent2,
            @Param("historyTime2") String historyTime2,
            @Param("chatType") Integer chatType,
            @Param("groupId") String groupId,
            @Param("parentFp") String parentFp);

    /**
     * 获取离线聊天消息的接口
     *
     * @param isIncludeFingerPring isIncludeFingerPring
     * @param fromUserUid          fromUserUid
     * @param userUid              userUid
     * @return 结果
     */
    List<OfflineMsgDTO> getOfflineFriendsMessages(@Param("isIncludeFingerPring") Boolean isIncludeFingerPring,
            @Param("fromUserUid") String fromUserUid,
            @Param("userUid") String userUid);

    /**
     * 删除离线列表消息
     *
     * @param userUid     userUid
     * @param fromUserUid fromUserUid
     * @return 结果
     */
    Integer deleteOfflineHistoryByFriendUserUid(@Param("userUid") String userUid,
            @Param("fromUserUid") String fromUserUid);
}
